package com.dkm.biz.gl.repository.impl;

import java.util.HashMap;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Repository;

import com.dkm.base.core.helper.SpringHelper;
import com.dkm.base.db.persistence.dao.IQueryDao;
import com.dkm.biz.gl.domain.Validate;
import com.dkm.biz.gl.persistence.dao.ValidateQueryDao;
import com.dkm.biz.gl.persistence.entity.ValidatePo;
import com.dkm.biz.gl.repository.ValidateRepository;
import com.dkm.biz.repository.AbstractRepository;

/**
 * 对象功能:skg_gl_validate Repository接口的实现类
 * 开发公司:SKG.COM
 * 开发人员:蔡东渠
 * 创建时间:2015-03-06 11:48:32
 */
@Repository
public class ValidateRepositoryImpl extends AbstractRepository<String, ValidatePo,Validate> implements ValidateRepository{
	  
	@Resource
	private  ValidateQueryDao validateQueryDao;

	public Validate newInstance() {
		ValidatePo po = new ValidatePo();
		Validate validate = SpringHelper.getBean(Validate.class);
		validate.setData(po);
		return validate;
	}

	public Validate newInstance(ValidatePo po) {
		Validate validate = SpringHelper.getBean(Validate.class);
		validate.setData(po);
		return validate;
	} 
	
	@Override
	protected IQueryDao<String, ValidatePo> getQueryDao() {
		return validateQueryDao;
	}

	@Override
	public ValidatePo getByKey(String key) {
		Map<String, Object> params=new HashMap<String, Object>();
		params.put("key", key);
		return validateQueryDao.getByKey("getByKey",params);
	}
	
}
